const Koa = require('koa')
const app = new Koa()
const Router = require('koa-router')
const router = new Router()
const bodyParser = require('koa-bodyparser')

const orderList=require('./mock/orderList')

app.use(bodyParser())
app.use(router.routes()).use(router.allowedMethods())
app.listen(8080, () => {
  console.log('80服务端口已启动！！！');
})

router.get('/list', ctx => {
  ctx.body = {
    code: 200,
    msg: '数据获取成功',
    orderList
  }
})